<template>
	<div class="charts" ref="charts"></div>
</template>

<script>
	// 引入echarts
	import * as echarts from 'echarts'
	export default {
		name: 'BarChart',
		mounted() {
			// 初始化echarts实例
			let lineChart = echarts.init(this.$refs.charts)
			// 配置数据
			lineChart.setOption({
				xAxis: {
					// 隐藏x轴
					show: false,
					type: 'category'
				},
				yAxis: {
					show: false
				},
				// 系列
				series: [{
					type: 'bar',
					data: [10, 7, 33, 13, 78, 98]
				}],
				tooltip: {
				},
				// 布局调试
				grid: {
					left: 0,
					top: 0,
					right: 0,
					bottom: 0
				}
			})
		}
	}
</script>

<style scoped>
	.charts {
		width: 100%;
		height: 100%;
	}
</style>
